import Layout from '@/layout/index.vue'
import tabbarRoutes from './tabbar'

export default [
  {
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      title: '登录',
      requireAuth: false,
    },
  },
  {
    path: '/',
    redirect: '/home',
    component: Layout,
    children: tabbarRoutes,
  },
  {
    path: '/user/:id',
    component: () => import('@/views/profile/user.vue'),
    meta: {
      title: '用户',
      requireAuth: true,
    },
  },
  {
    path: '/user/statistics/:id',
    component: () => import('@/views/profile/statistics.vue'),
    meta: {
      title: '统计',
      requireAuth: true,
    },
  },
  {
    path: '/chat/detail/:id',
    component: () => import('@/views/chat/detail.vue'),
    meta: {
      title: '聊天',
      requireAuth: true,
    },
  },
  {
    path: '/chat/create',
    component: () => import('@/views/chat/create.vue'),
    meta: {
      title: '创建群聊',
      requireAuth: true,
    },
  },
  {
    path: '/chat/search',
    component: () => import('@/views/chat/search.vue'),
    meta: {
      title: '搜索',
      requireAuth: true,
    },
  },
]
